import { Provide } from '@midwayjs/decorator';
import { CoolController, BaseController } from '@cool-midway/core';
import { MenuEntity } from '../../entity/menu';

/**
 * 导航菜单
 */
@Provide()
@CoolController({
  api: ['add', 'delete', 'update', 'info', 'list', 'page'],
  entity: MenuEntity,
  // 分页查询配置
  pageQueryOp: {
    // 支持模糊查询的字段
    keyWordLikeFields: ['name'],
    // 添加排序
    addOrderBy: {
      sort: 'desc'
    },
    fieldEq: ['status', 'vip', 'type'],
  },
})
export class MenuController extends BaseController { }